#include<stdio.h>
#include<sys/types.h>
#include<unistd.h>
int main()
{
  printf("I am father process,pid:%d\n",getpid());
  pid_t ret =fork();
  //变成两个进程，一个是父进程，一个是子进程
  printf("ret:%d, pid:%d, ppid:%d\n",ret,getpid(),getppid());
  sleep(1);
  /*
  while(1)
  {
    pid_t id=getpid();//获取的是自己的进程PID
    iprintf("pid:%d\n",id);
    sleep(1);
  }
  */
  return 0;
}
